package com.chengh.springboot.demo.demo02;

/**
 * 循环调用接口案例
 *
 * @author chenghang
 * @date 2021/12/4 10:02
 */
public class WhileCall {

    public static void main(String[] args) {
        int allTotals = 103;
        int pageSize = 10;
        int totalPage = allTotals % pageSize == 0 ? allTotals / pageSize : allTotals / pageSize + 1;
        System.out.println(totalPage);
        if (totalPage > 1) {
            for (int i = 2; i <= totalPage; i++) {
                System.out.println(i);
            }
        }
    }
}
